package com.cykj.feign.impl;

import com.cykj.feign.CyGoodControllerOpenFeign;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CyGoodControllerFeignFactoryImpl implements FallbackFactory<CyGoodControllerOpenFeign> {
    @Override
    public CyGoodControllerOpenFeign create(Throwable cause) {
        cause.printStackTrace(); // 异常打印
        System.out.println("发生熔断了");
        // 采用降级措施
        return new CyGoodControllerOpenFeignImpl();
    }
}
